import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

// 首页分类（我的设备，卡片管理等）
class XyLocalNav extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: false);
    return Container(
      height: ScreenUtil().setHeight(160),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setSp(16)))
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: <Widget>[
          _item('static/homeIcon1.png', '我的设备'),
          _item('static/homeIcon1.png', '卡片管理'),
          _item('static/homeIcon1.png', '我的计划'),
          _item('static/homeIcon1.png', '交易查询'),
          _item('static/homeIcon1.png', '查看更多'),
        ],
      ),
    );
  }
  
  
  Widget _item(url, name) {
    return Container(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Image.asset(url, width: ScreenUtil().setWidth(47.23), height: ScreenUtil().setWidth(51.92),),
          Center(
            child: Text(name, style: TextStyle(fontSize: ScreenUtil().setSp(24), fontFamily: 'PingFang', color: Color(0xFF333333)),),
          )
        ],   
      ),
    );
  }
}
